package com.huige.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author 朱志辉
 * @Create 2024/7/18 上午1:03
 * @Version 1.0
 * Description:
 */
@Controller
public class HelloController {

    //handler - > springmvc/hello return "hello springmvc!!"
    @RequestMapping("springmvc/hello")//对外访问的地址 到handlerMapping注册的方式
    @ResponseBody//直接返回字符串给前端不要找视图解析器
    public String hello() {

        System.out.println("HelloController.hello");

        //返回给前端
        return "hello springmvc!!";
    }
}
